/*
 * @Author: fishroom
 * @Date: 2021-08-22 20:46:04
 * @LastEditTime: 2021-09-07 15:43:17
 * @FilePath: \backstage\src\store\background\background.js
 */

import axios from "axios";
//后台管理请求

// 后台-分页获取信息-所有列表信息
// 基础信息
export function background_All_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/queryZuoLuos",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      this.commit("GetAllInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 营房操作
export function Get_barracks_Info({ commit }, obj) {
  axios({
    url: "/api/zl/campsite/queryCampsite",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetbarInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 酒店操作
export function Get_hotel_Info({ commit }, obj) {
  axios({
    url: "/api/zl/queryHotel",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetHotelInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 靶场操作
export function Get_ranges_Info({ commit }, obj) {
  axios({
    url: "/api/zl/range/queryRange",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetRangeInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 仓储信息
export function Get_storange_Info({ commit }, obj) {
  axios({
    url: "/api/zl/warehouse/queryWareHouse",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetStorangeInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 养殖场操作
export function Get_farm_Info({ commit }, obj) {
  axios({
    url: "/api/zl/farm/queryFarm",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetFarmInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
//历史沿革
export function Get_history_Info({ commit }, obj) {
  axios({
    url: "/api/zl/history/queryHistory",
    method: "GET",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("GetHistoryInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 楼栋信息
export function Get_floor_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/building/queryBuilding",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      this.commit("GetFloorInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 设备信息
export function Get_facility_Info({ commit }, obj) {
  axios({
    url: "/api/zl/device/queryDevice",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("GetFacilityInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 遗留问题
export function Get_leftProblem_Info({ commit }, obj) {
  axios({
    url: "/api/zl/problem/queryProblem",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("GetLeftProblemInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 后台-电梯信息-获取所有信息列表
export function Get_elevator_Info({ commit }, obj) {
  axios({
    url: "/api/zl/elevator/queryElevator",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("GetElevatorInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 后台-工程信息-获取所有信息列表
export function Get_project_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/engineering/queryEngineering",
    params: {
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    },
    method: "GET"
  })
    .then(res => {
      this.commit("GetProjectInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台- 基础信息-所有信息列表-单条数据详情
export function get_current_info({ commit }, id) {
  axios
    .get("/api/zl/queryZuoLuoById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetCurrentInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 后台-基础信息-所有信息列表-删除单条数据
export function delete_current_info({ commit }, id) {
  axios
    .delete("/api/zl/deleteZuoLuo?id=" + id)
    .then(res => {
      console.log(res);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-营房操作--获取单条数据
export function Get_Barracks_CurInfo({ commit }, id) {
  axios.get("/api/zl/campsite/findCampsiteById?id=" + id).then(res => {
    console.log(res.data.data);
    this.commit("GetBarracksCurInfo", res.data.data);
  });
}

// 后台-酒店操作-所有列表信息-详情
export function Get_Hotel_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/findHotelById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetHotelCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-靶场操作-所有列表信息-详情
export function Get_Range_CurInfo({ commit }, id) {
  axios.get("/api/zl/range/findRangeById?id=" + id).then(res => {
    console.log(res.data.data);
    this.commit("GetRangesCurInfo", res.data.data);
  });
}

// 后台-仓储信息-所有列表信息-详情
export function Get_Storage_CurInfo({ commit }, id) {
  axios.get("/api/zl/warehouse/findWareHouseById?id=" + id).then(res => {
    console.log(res.data.data);
    this.commit("GetStorageCurInfo", res.data.data);
  });
}

// 后台-养殖场操作-获取所有列表信息-详情
export function Get_Farm_CurInfo({ commit }, id) {
  axios.get("/api/zl/farm/findFarmById?id=" + id).then(res => {
    console.log(res.data.data);
    this.commit("GetFarmCurInfo", res.data.data);
  });
}

// 后台-历史沿革-获取所有列表信息-详情
export function Get_History_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/history/findHistoryById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetHistoryCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-楼栋信息-获取所有列表信息-详情
export function Get_Floor_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/building/findBuildingById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetFloorCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-设备信息-获取所有列表信息-详情
export function Get_Facility_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/device/findDeviceById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("FetFacillityCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-遗留问题-获取所有列表信息-详情
export function Get_LeftProblem_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/device/findDeviceById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetLeftProblemCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-电梯信息-获取所有列表信息-详情
export function Get_Elevator_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/elevator/findElevatorById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetElevatorCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 后台-工程信息-搜索
export function Search_project_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/engineering/queryEngineering",
    method: "GET",
    params: {
      zlName: obj.zlName,
      pageNum: obj.pageNum,
      pageSize: obj.pageSize
    }
  })
    .then(res => {
      this.commit("SearchProjectInfo", res.data.data);
      console.log(res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 后台-工程信息-获取所有列表信息-详情
export function Get_Project_CurInfo({ commit }, id) {
  axios
    .get("/api/zl/engineering/findEngineeringById?id=" + id)
    .then(res => {
      console.log(res.data.data);
      this.commit("GetProjectCurInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 上传图片
export function upload_file({ commit }, obj) {
  axios({
    url: "/api/zl/file/img",
    params: {
      param: obj.param,
      config: obj.config
    },
    method: "POST"
  }).then(res => {
    this.commit("UploadPhoto", res.data.data);
    console.log(res.data.data);
  });
}
// 字典查询
export function dictionariesSearch({ commit }, id) {
  axios
    .post("/api/zl/dictionary/findDicByDictionaryId?dictionaryId=" + id)
    .then(res => {
      commit("getDictionaryItem", res.data.data);
    });
}

// 删除
//基础信息
export function Del_Info({ commit }, id) {
  axios({
    url: "/api/zl/deleteZuoLuo",
    method: "DELETE",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 营房操作
export function Del_Barracks_Info({ commit }, id) {
  axios({
    url: "/api/zl/campsite/deleteByIdCampsite",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelBarracksInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 酒店操作
export function Del_Hotel_Info({ commit }, id) {
  axios({
    url: "/api/zl/deleteByIdHotel",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelHotelInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 靶场操作
export function Del_Range_Info({ commit }, id) {
  axios({
    url: "/api/zl/range/deleteByIdRange",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelRangeInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 仓储操作
export function Del_Storage_Info({ commit }, id) {
  axios({
    url: "/api/zl/warehouse/deleteWareHouse",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelStorageInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 养殖场操作
export function Del_Farm_Info({ commit }, id) {
  axios({
    url: "/api/zl/farm/deleteByIdFarm",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelFarmInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 历史沿革
export function Del_History_Info({ commit }, id) {
  axios({
    url: "/api/zl/history/deleteHistory",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelHistoryInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 楼栋信息
export function Del_Floor_Info({ commit }, id) {
  console.log(id);
  axios({
    url: "/api/zl/building/deleteByIdBuilding",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelFloorInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 设备信息
export function Del_Facility_Info({ commit }, id) {
  axios({
    url: "/api/zl/device/deleteByIdDevice",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelFacilityInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 遗留问题
export function Del_LeftProblem_Info({ commit }, id) {
  axios({
    url: "/api/zl/problem/deleteByIdProblem",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelLeftProblemInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 电梯信息
export function Del_Elevator_Info({ commit }, id) {
  axios({
    url: "/api/zl/elevator/deleteElevator",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelElevatorInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 工程信息
export function Del_Project_Info({ commit }, id) {
  axios({
    url: "/api/zl/engineering/deleteEngineering",
    method: "POST",
    params: {
      id: id
    }
  })
    .then(res => {
      console.log(res.data.data);
      this.commit("DelProjectInfo", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 新增
// 基础信息
export function Inc_Info({ commit }, obj) {
  axios({
    url: "/api/zl/campsite/addCampsite",
    method: "POST",
    params: {}
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 营房操作
export function Inc_Barracks_Info({ commit }, obj) {
  axios({
    url: "/api",
    method: "POST",
    params: {
      id: obj.id,
      zlName: obj.zlName,
      yfNo: obj.yfNo,
      yfName: obj.yfName,
      buildYear: obj.buildYear,
      useYear: obj.useYear,
      intro: obj.intro,
      status: obj.status,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncBarracksInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 酒店操作
export function Inc_Hotel_Info({ commit }, obj) {
  axios({
    url: "/api/zl/addHotel",
    method: "POST",
    params: {
      param: obj.param,
      config: obj.config
    },
    method: "POST"
  }).then(res => {
    this.commit("UploadPhoto", res.data.data);
    console.log(res.data.data);
  });
}
// 字典页面默认展示
export function dictionariesList({ commit }, page) {
  axios
    .get("/api/zl/dictionary/queryDictionary?pgeNum=" + page + "&pageSize=10")
    .then(res => {
      commit("getDictionaryItem", res.data.data.list);
      commit("getDictionaryLen", res.data.data.total);
    });
}
// 靶场操作
export function Inc_Range_Info({ commit }, obj) {
  axios({
    url: "/api/zl/range/addRange",
    method: "POST",
    params: {
      zlId: obj.zlId,
      ZlName: obj.ZlName,
      rangeNo: obj.rangeNo,
      rangeName: obj.rangeName,
      icon: obj.icon,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncRangeInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 仓储操作
export function Inc_Storage_Info({ commit }, obj) {
  axios({
    url: "/api/zl/warehouse/addWareHouse",
    method: "POST",
    params: {
      zlId: obj.zlId,
      zlName: obj.zlName,
      warehouseNo: obj.warehouseNo,
      warehouseName: obj.warehouseName,
      typeId: obj.typeId,
      typeName: obj.typeName,
      principal: obj.principal,
      phone: obj.phone,
      headerImg: obj.headerImg,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncStorageInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 养殖场操作
export function Inc_Farm_Info({ commit }, obj) {
  axios({
    url: "/api/zl/farm/addFarm",
    method: "POST",
    params: {
      zlId: obj.zlId,
      farmNo: obj.farmNo,
      farmName: obj.farmName,
      farmType: obj.farmType,
      intro: obj.intro,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncFarmInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 历史沿革
export function Inc_History_Info({ commit }, obj) {
  axios({
    url: "/api/zl/history/addHistory",
    method: "POST",
    params: {
      zlId: obj.zlId,
      historyIntro: obj.historyIntro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncHistoryInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 楼栋信息
export function Inc_Floor_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/building/addBuilding",
    method: "POST",
    params: {
      zlId: obj.zlId,
      buildingNo: obj.buildingNo,
      buildingPlies: obj.buildingPlies,
      buildTime: obj.buildTime,
      buildYear: obj.buildYear,
      intro: obj.intro,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncFloorInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 设备信息
export function Inc_Facility_Info({ commit }, obj) {
  axios({
    url: "/api/zl/device/addDevice",
    method: "POST",
    params: {
      zlId: obj.zlId,
      waDesignCapacity: obj.waDesignCapacity,
      waSjNumber: obj.waSjNumber,
      power: obj.power,
      dynamo: obj.dynamo,
      gaDesignCapacity: obj.gaDesignCapacity,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncFacilityInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 遗留问题
export function Inc_LeftProblem_Info({ commit }, obj) {
  axios({
    url: "/api/zl/problem/addProblem",
    method: "POST",
    params: {
      zlId: obj.zlId,
      typeId: obj.typeId,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncLeftProblemInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}

// 电梯信息
export function Inc_Elevator_Info({ commit }, obj) {
  axios({
    url: "/api/zl/elevator/addElevator",
    method: "POST",
    params: {
      buildingId: obj.buildingId,
      buildingNo: obj.buildingNo,
      elevator: obj.elevator,
      elevatorModel: obj.elevatorModel,
      capacityValue: obj.capacityValue,
      installYear: obj.installYear,
      intro: obj.intro,
      createBy: obj.createBy,
      updateBy: obj.updateBy,
      updateTime: obj.updateTime,
      createTime: obj.createTime
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("IncElevatorInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 工程信息
export function Inc_Project_Info({ commit }, obj) {
  // console.log(obj);
  axios({
    url: "/api/zl/engineering/addEngineering",
    method: "POST",
    params: {
      zlId: obj.zlId,
      engineeringNo: obj.engineeringNo,
      engineeringName: obj.engineeringName,
      typeId: obj.typeId,
      approveNo: obj.approveNo,
      approveName: obj.approveName,
      approveTime: obj.approveTime,
      startTime: obj.startTime,
      endTime: obj.endTime,
      budgetAmount: obj.budgetAmount,
      settleAmount: obj.settleAmount,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res);
      this.commit("IncProjectInfo", res.data.data);
      console.log(res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 编辑
// 基础信息
export function EditInfo({ commit }, obj) {
  axios({
    url: "/api",
    method: "POST",
    params: {}
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 营房操作
export function Edit_Barracks_Info({ commit }, obj) {
  axios({
    url: "/api/zl/campsite/updateCampsite",
    method: "POST",
    params: {
      id: obj.id,
      zlName: obj.zlName,
      yfNo: obj.yfNo,
      yfName: obj.yfName,
      buildYear: obj.buildYear,
      useYear: obj.useYear,
      intro: obj.intro,
      status: obj.status,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdBarracksInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 酒店操作
export function Edit_Hotel_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/updateHotel",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      hotelNo: obj.hotelNo,
      hotelName: obj.hotelName,
      hotelLevel: obj.hotelLevel,
      businessScope: obj.businessScope,
      floor: obj.floor,
      rooms: obj.rooms,
      businessLicense: obj.businessLicense,
      intro: obj.intro,
      status: obj.status,
      createTime: obj.createTime,
      createBy: obj.createBy,
      updateBy: obj.updateBy,
      updateTime: obj.updateTime,
      remark: obj.remark,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdHotelInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 靶场操作
export function Edit_Range_Info({ commit }, obj) {
  axios({
    url: "/api/zl/range/updateRange",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      ZlName: obj.ZlName,
      rangeNo: obj.rangeNo,
      rangeName: obj.rangeName,
      icon: obj.icon,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdRangeInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 仓储操作
export function Edit_Storange_Info({ commit }, obj) {
  axios({
    url: "/api/zl/warehouse/updateWareHouse",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      zlName: obj.zlName,
      warehouseNo: obj.warehouseNo,
      warehouseName: obj.warehouseName,
      typeId: obj.typeId,
      typeName: obj.typeName,
      principal: obj.principal,
      phone: obj.phone,
      headerImg: obj.headerImg,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdStorangeInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 养殖场操作
export function Edit_Farm_Info({ commit }, obj) {
  axios({
    url: "/api/zl/farm/updateFarm",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      farmNo: obj.farmNo,
      farmName: obj.farmName,
      farmType: obj.farmType,
      intro: obj.intro,
      icon: obj.icon
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdFarmInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 历史沿革
export function Edit_History_Info({ commit }, obj) {
  axios({
    url: "/api/zl/history/updateHistory",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      historyIntro: obj.historyIntro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdHistoryInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 楼栋信息
export function Edit_Floor_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/building/updateBuilding",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      buildingNo: obj.buildingNo,
      buildingPlies: obj.buildingPlies,
      buildTime: obj.buildTime,
      buildYear: obj.buildYear,
      intro: obj.intro,
      icon: obj.icon
    }
  })
    .then(res => {
      this.commit("EdFloorInfo", res.data);
      console.log(res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 设备信息
export function Edit_Facility_Info({ commit }, obj) {
  console.log(obj);
  axios({
    url: "/api/zl/device/updateDevice",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      waDesignCapacity: obj.waDesignCapacity,
      waSjNumber: obj.waSjNumber,
      power: obj.power,
      dynamo: obj.dynamo,
      gaDesignCapacity: obj.gaDesignCapacity,
      intro: obj.intro
    }
  })
    .then(res => {
      this.commit("EdFacilityInfo", res.data);
      console.log(res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 遗留问题
export function Edit_LeftProblem_Info({ commit }, obj) {
  axios({
    url: "/api/zl/problem/updateProblem",
    method: "POST",
    params: {
      id: obj.id,
      zlId: obj.zlId,
      typeId: obj.typeId,
      intro: obj.intro
    }
  })
    .then(res => {
      console.log(res.data);
      this.commit("EdLeftProblemInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 电梯信息
export function Edit_Elevator_Info({ commit }, obj) {
  console.log(1111, obj);
  axios({
    url: "/api/zl/elevator/updateElevator",
    method: "POST",
    params: {
      id: obj.id,
      buildingId: obj.buildingId,
      buildingNo: obj.buildingNo,
      elevatorNo: obj.elevatorNo,
      elevatorModel: obj.elevatorModel,
      capacityValue: obj.capacityValue,
      installYear: obj.installYear,
      intro: obj.intro,
      createBy: obj.createBy,
      updateBy: obj.updateBy,
      updateTime: obj.updateTime,
      createTime: obj.createTime
    }
  })
    .then(res => {
      this.commit("EdElevatorInfo", res.data);
    })
    .catch(err => {
      console.log(err);
    });
}
// 工程信息
export function EditProjectInfo({ commit }, obj) {
  console.log("11", obj);
  axios({
    url: "/api/zl/engineering/updateEngineering",
    method: "POST",
    params: {
      zlId: obj.zlId,
      engineeringNo: obj.engineeringNo,
      engineeringName: obj.engineeringName,
      typeId: obj.typeId,
      approveNo: obj.approveNo,
      approveName: obj.approveName,
      approveTime: obj.approveTime,
      startTime: obj.startTime,
      endTime: obj.endTime,
      budgetAmount: obj.budgetAmount,
      settleAmount: obj.settleAmount,
      intro: obj.intro,
      createTime: obj.createBy,
      updateTime: obj.updateTime,
      updateBy: obj.updateBy,
      remark: obj.remark,
      createBy: obj.createBy,
      id: obj.id
    }
  })
    .then(res => {
      console.log(res);
      this.commit("EdProjectInfo", res.data);
      console.log(res);
    })
    .catch(err => {
      console.log(err);
    });
}
// 添加字典
export function dictionariesAddText({ commit }, obj) {
  axios
    .post(
      "/api//zl/dictionary/addDictionary?dictionaryId=" +
        obj.dictionaryId +
        "&typeName=" +
        obj.name
    )
    .then(res => {
      console.log(res);
    })
    .catch(err => {
      console.log(err);
    });
}
// 获取所有用户
export function getUserList({ commit }, page) {
  axios
    .get("/api/zl/user/queryUser?PageNum=" + page + "&PageSize=10")
    .then(res => {
      console.log(res.data.data);
      commit("getUser", res.data.data);
    })
    .catch(err => {
      console.log(err);
    });
}
